<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%
 String path = request.getContextPath();
 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<title>Login</title>
<script type="application/x-javascript"> 
addEventListener("load", function() { 
	setTimeout(hideURLbar, 0); }, false); 
	function hideURLbar(){ 
		window.scrollTo(0,1); 
		} 
</script>
<script type="text/javascript">
	var httpRequest;
	function sendRequest(url)
	{
		if(window.XMLHttpRequest)
		{
			httpRequest = new XMLHttpRequest();
		}else if(window.ActiveXObject)
		{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}
		httpRequest.open("get",url,true);
		httpRequest.onreadystatechange = processResponse;
		httpRequest.send(null);
	}
	function processResponse()
	{
		if(httpRequest.readyState == 4)
		{
			if(httpRequest.status == 200)
			{
			//	var res = httpRequest.responseText;
			//	alert(res);
				window.location.href = "/ADVideoManager/index.do";
			}else
				{
				window.alert("请求页面异常！");
				}
		}
	}
	function userCheck()
	{
		var userName = document.f.name.value;
		var pwd = document.f.pwd.value;
		if(userName == "")
		{
			window.alert("用户名不能为空！");
		}else
		{
			var url = "/ADVideoManager/login.do?userName="+userName+"&pwd="+pwd;
			sendRequest(url);
		}
	}
</script>
</head>
<body>
<div class="container">
<h1>DARK LOGIN FORM</h1>
     <div class="contact-form">
	 <div class="signin">
     <form action="" method="post" name="f">
	      <p>Username</p>
	      <input type="text" class="user" name="name" value="Enter Here" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Enter Here';}" />
		  <p>Password <a href="#">Forgot your password?</a></p>
		  <input type="password" class="pass" name="pwd" value="Password" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Password';}" />
          <label>
		  <input type="checkbox" value="Remember-Me" /> Remember Me?
		  </label>
          <input type="button" value="Login"  onclick="userCheck()"/>
	 </form>
	 </div>
	 </div>	 
</div>
</body>
</html>